[release/7.0] Port #82470 (disable EventPipe stack collection with environment variable) to 7.0 #82921
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Port of #82470. We have an internal partner who is blocked from moving to EventPipe on Linux due to the performance hit of collecting stacks when firing events.
Customer Impact
Currently in EventPipe the provider defines whether or not to collect stack for each event. Stack collection is very expensive when compared to firing an event, and when an app starts emitting enough events it can cause a significant slowdown. Some scenarios do not care about the event stacks and want to fire many events, this will let them turn off stack collection globally.
Testing
Manual testing by the dev team and partner validation
Risk
Low. This feature is opt in, turning off stack collection may break some diagnostics scenarios but the user has to intentionally disable stack collection. The default of the runtime remains unchanged.